import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 零售订单维护	查询订单数据	retail	 /vsRetailOrder/searchRetailOrder get
export const queryRetailOrder = (params) => axios.get(`${SERVER.RETAIL}/vsRetailOrder/searchRetailOrder`, {
  params
});

// 零售订单维护	查询潜客	CYXDMS_CLUE	 零售单查询潜客接口地址已改 beijing也需要改--刘诗文传达 	get
export const queryPotentialCustomer = (params) => axios.get(`${SERVER.CYXDMS_CLUE}/customerOldIntentLevel/potentialCustomerNameAndPhoneForRetail`, {
  params
});

// 零售订单维护	查询销售顾问	sysmanage	 /employeeNew/getEmployees	get
export const getEmployees = (params) => axios.get(`${SERVER.SYSMANAGE}/employeeNew/getEmployees`, {
  params
});

// 零售订单维护	查询车	retail	 /vsRetailOrder/searchVinForOrder?colorId=12&currentPage=1&modelId=1&optionId=1&packageId=1&pageSize=10&productId=3&seriesId=1&trimColorId=76&vin=185	get
export const queryVinForOrder = (params) => axios.get(`${SERVER.RETAIL}/vsRetailOrder/searchVinForOrder`, {
  params
});

// 零售订单维护	保存订单（传id是更新）	retail	 /vsRetailOrder/saveOrder	post
export const saveOrder = (params) => axios.post(`${SERVER.RETAIL}/vsRetailOrder/saveOrder`, params)

// 零售订单维护	提交订单（传id是更新）	retail	 /vsRetailOrder/commitOrder	post
export const commitOrder = (params) => axios.post(`${SERVER.RETAIL}/vsRetailOrder/commitOrder`, params)


// 零售订单维护	根据id查询详情	retail	 /vsRetailOrder/searchRetailOrderById?id=4	get
export const queryRetailOrderById = (Id) => axios.get(`${SERVER.RETAIL}/vsRetailOrder/searchRetailOrderById?id=${Id}`);
// 零售订单维护	取消订单	retail	 /vsRetailOrder/cancleOrder	post
export const cancleOrder = (params) => axios.post(`${SERVER.RETAIL}/vsRetailOrder/cancleOrder`, params)

// 零售订单维护	出库	retail	 /vsRetailOrder/stockOut	post
export const stockOut = (params) => axios.post(`${SERVER.RETAIL}/vsRetailOrder/stockOut`, params)
export const querySeriessList = () => axios.get(`${SERVER.BASEDATA}/vehicleProduct/seriess/all`)
